from django.db import models

# Create your models here.


class Userinfo(models.Model):
    id = models.BigAutoField(primary_key=True)
    username = models.CharField(max_length=32)
    password = models.CharField(max_length=64)


class Comment(models.Model):
    eid = models.AutoField(primary_key=True)
    content = models.TextField(blank=True, null=True)
    send_time = models.DateField(blank=True, null=True)
    user_name = models.CharField(max_length=32, blank=True, null=True)
    shop_star = models.FloatField(blank=True, null=True)
    shop_url = models.CharField(max_length=64, blank=True, null=True)


class Shop(models.Model):
    sid = models.AutoField(primary_key=True)
    shop_url = models.IntegerField(blank=True, null=True)  # 店铺id
    city = models.CharField(max_length=64, blank=True, null=True)  # 城市
    shop_name = models.CharField(max_length=64, blank=True, null=True)  # 店铺名
    shop_star = models.FloatField(blank=True, null=True)  # 评分
    shop_avg_price = models.IntegerField(blank=True, null=True)  # 人均
    shop_review_num = models.IntegerField(blank=True, null=True)  # 评论数
    shop_type = models.CharField(max_length=32, blank=True, null=True)  # 店铺类型
    shop_local = models.CharField(max_length=64, blank=True, null=True)  # 店铺位置
    shop_recommend = models.CharField(max_，length=64, blank=True, null=True)  # 推荐菜
    comments = models.ManyToManyField(Comment)

